import matplotlib.pyplot as plt


class ROCVisualizer:
    """结果可视化类"""

    @staticmethod
    def plot_auc_curves(results):
        plt.figure(figsize=(10, 8))
        for model_name, metrics in results.items():
            plt.plot(
                metrics['fpr'],
                metrics['tpr'],
                label=f"{model_name} (AUC = {metrics['auc']:.2f})"
            )
        plt.plot([0, 1], [0, 1], 'k--')
        plt.xlim([0.0, 1.0])
        plt.ylim([0.0, 1.05])
        plt.xlabel('False Positive Rate')
        plt.ylabel('True Positive Rate')
        plt.title('ROC Curves Comparison')
        plt.legend(loc="lower right")
        plt.show()
